package com.umakr.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yangliu on 2017/8/10.
 */
@RequestMapping("/day09")
@Controller
public class Controller09 {

    @RequestMapping("/test09")
    public ModelAndView show(){
        ModelAndView mav = new ModelAndView();
        mav.setViewName("day09/form");
        return mav;
    }

    @RequestMapping("/test9")
    @ResponseBody
    public Object form(String username,String password){
     Map<String,String> map = new HashMap<>();
     map.put("username",username);
     map.put("password",password);
     map.get("username");
     return map;
    }
}
